num=input("请输入一串数字");
nums=[];
for i in num.split(","):
    nums.append(int(i));
target=int(input("请输入一个目标值"));
nums2=[];
for a in range(0,len(nums)-3):
    for b in range(a+1,len(nums)-2):
        for c in range(b+1,len(nums)-1):
            for d in range(c+1,len(nums)):
                if (nums[a] + nums[b] + nums[c] + nums[d] == target):
                    list = [nums[a],nums[b],nums[c],nums[d]];
                    nums2.append(list);
for i in range(0,len(nums2)-1):
    for j in range(i+1,len(nums2)):
        if(sorted(nums2[i])==sorted(nums2[j])):
            nums2.remove(nums2[j]);
print(nums2);



